home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
SGI Enlighten DSM 1.1
/
SGI EnlightenDSM 1.1.iso
/
hp10x
/
flexlm.z
/
flexlm
/
FLEXlm
/
stop_dsmld
< prev
Wrap
Text File
|
1998-06-30
|
1KB
|
63 lines
#!/bin/sh
#
# Script: stop_dsmld
#
# stop_dsmld stops Enlighten license daemons lmgrd and dsmld
#
# Note: I tried to use $* to pass "$procs" around, but
# SCO fails to deal with $* properly in the context of a function.
#
# Copyright (c) 1990-1998 Enlighten Software Solutions, Inc.
# All Rights Reserved.
#
PATH=/bin:/usr/bin:/etc:/usr/ucb:/usr/bsd:/usr/etc:$PATH
export PATH
appName="stop_dsmld"
#
# Get emd directory
#
emd_dir=`egrep "^emd_dir=" /etc/enlighten | cut "-d=" -f2-`
if [ -z "$emd_dir" -o ! -d "$emd_dir" ] ; then
echo "$appName: Unable to determine FLEXlm directory."
echo "$appName: Unable to stop daemons."
exit 1
else
flex_dir="${emd_dir}/FLEXlm"
if [ ! -x ${flex_dir}/lmutil ] ; then
echo "$appName: Unable to find lmutil."
echo "$appName: Unable to stop daemons."
exit 1
fi
fi
lic_file="${flex_dir}/license.dat"
dsmld="dsmld"
#
# Bring the daemons down
#
${flex_dir}/lmutil lmdown -c ${flex_dir}/license.dat -q
#
# see if they are still up
#
# we need to match both a hostname and an IP address
lmgrdstat=`${flex_dir}/lmutil lmstat -c $lic_file | egrep "^ *[a-zA-Z]*[0-9.]*: license server" | awk '{print $4}'`
dsmldstat=`${flex_dir}/lmutil lmstat -c $lic_file | egrep "^ *$dsmld" | awk '{print $2}'`
if [ "$lmgrdstat" = "UP" -o "$dsmldstat" = "UP" ] ; then
echo "$app_name: License daemons failed to stop."
echo "$app_name: See $log_file for details."
exit 1
fi
echo "$appName: Finished."
exit 0